package ai.assist.common.businesss.mongo.entity;

import com.anwen.mongo.annotation.ID;
import com.anwen.mongo.annotation.collection.CollectionField;
import com.anwen.mongo.annotation.collection.CollectionName;
import com.anwen.mongo.enums.IdTypeEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统日志
 * @TableName sys_log
 */
@CollectionName(value ="sys_log")
@Data
public class SysLog implements Serializable {

    @ID(type = IdTypeEnum.OBJECT_ID)
    @CollectionField("_id")
    private String id;

    /**
     * 用户id
     */
    @CollectionField(value = "user_id")
    private String userId;

    /**
     * 用户名
     */
    @CollectionField(value = "username")
    private String username;

    private String realName;

    /**
     * token
     */
    @CollectionField(value = "token")
    private String token;

    /**
     * 用户操作
     */
    @CollectionField(value = "operation")
    private String operation;

    /**
     * 响应时间
     */
    @CollectionField(value = "time")
    private Integer time;

    /**
     * 请求方法
     */
    @CollectionField(value = "method")
    private String method;

    /**
     * url
     */
    @CollectionField(value = "url")
    private String url;

    /**
     * 请求参数
     */
    @CollectionField(value = "params")
    private String params;

    /**
     * 响应结果
     */
    @CollectionField(value = "response")
    private String response;

    /**
     * IP地址
     */
    @CollectionField(value = "ip")
    private String ip;

    /**
     * 创建时间
     */
    @CollectionField(value = "create_time")
    private Date createTime;

    @CollectionField(exist = false)
    private static final long serialVersionUID = 1L;
}
